import Page
from Page import Service
from Base.Base import Base
from selenium.webdriver.common.by import By


class ServiceNewoperatingPage(Base):
    """
    车服务新手引导界面
    """

    def __init__(self, driver):
        Base.__init__(self, driver)

        # 知道了按钮
        self.operating_know_text = (By.XPATH, Service.RESOURCE_ID.format("tv_next"))

        # 去维保图片
        self.operating_go_img = (By.XPATH, Service.RESOURCE_ID.format("iv_guide_bg"))

    def click_operating_know(self):
        """
        点击知道了按钮

        :return:
        """
        if self.is_display_know():
            self.click_element(self.operating_know_text)

    def is_display_know(self):
        """
        是否含有新手引导页面

        :return:
        """
        return self.is_display(self.operating_know_text)

    def get_operating_go(self):
        """
        获取新手引导界面

        :return: 获取元素
        """
        return self.find_element_o(self.operating_go_img)
